package com.itheima.wallet.dao;


import com.itheima.wallet.model.Account;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface AccountMapper {

    String insertAccountSql = "insert into tb_account values(null,#{balance},#{createTime},#{updateTime},#{accountName})";

    /**
     * 添加账户
     *
     * @param account
     */
    @Insert(value = insertAccountSql)
    void insertAccount(Account account);

    String selectAcountByAccountIdSql = "select name as accountName from account where id = #{accountId}";

    /**
     *  根据账户id查询账户信息
     * @param accountId
     * @return
     */
    @Select(value = selectAcountByAccountIdSql)
    Account selectAcountByAccountId(Long accountId);


}
